#!/bin/bash
###SHELLPACK preamble libmicro-string-bench 1

###SHELLPACK parseargBegin
###SHELLPACK parseargInstall
###SHELLPACK parseargEnd
###SHELLPACK monitor_hooks

###SHELLPACK check_install_required libmicro-string-${VERSION}
###SHELLPACK init_complete

cd $SHELLPACK_SOURCES/libmicro-string-${VERSION}-installed || die "Failed to cd to libmicro directory"

COMMON="-E -C 0 -D 30000 -B 10000 -L -S -W"

while read A B C; do
	monitor_pre_hook $LOGDIR_RESULTS $A-$B
	if [ -f bin/$A ]; then
		eval bin/$A $COMMON -N "$B" $C 2>&1 > $LOGDIR_RESULTS/$B.log
	fi
	monitor_post_hook $LOGDIR_RESULTS $A-$B
done <<EOT
memset	memset_10	-s 10
memset	memset_256	-s 256
memset	memset_256_u	-s 256	 -a 1
memset	memset_1k	-s 1k
memset	memset_4k	-s 4k
memset	memset_4k_uc	-s 4k -u
memset	memset_10k	-s 10k
memcpy	memcpy_10	-s 10
memcpy	memcpy_1k	-s 1k
memcpy	memcpy_10k	-s 10k
strcpy	strcpy_10	-s 10
strcpy	strcpy_1k	-s 1k
strlen	strlen_10	-s 10
strlen	strlen_1k	-s 1k
strchr	strchr_10	-s 10
strchr	strchr_1k	-s 1k
strcmp	strcmp_10	-s 10
strcmp	strcmp_1k	-s 1k
strcasecmp	scasecmp_10	-s 10
strcasecmp	scasecmp_1k	-s 1k
EOT

exit $SHELLPACK_SUCCESS
